<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>HTML与CSS学习第1天 | 凌歆的博客</title>
    <meta name="generator" content="VuePress 1.9.5">
    <link rel="icon" href="/img/favicon.ico">
    <meta name="description" content="web前端技术博客,专注web前端学习与总结。JavaScript,js,ES6,TypeScript,vue,React,python,css3,html5,Node,git,github等技术文章。">
    <meta name="keywords" content="前端博客,个人技术博客,前端,前端开发,前端框架,web前端,前端面试题,技术文档,学习,面试,JavaScript,js,ES6,TypeScript,vue,python,css3,html5,Node,git,github,markdown">
    <meta name="baidu-site-verification" content="7F55weZDDc">
    <meta name="theme-color" content="#11a8cd">
    
    <link rel="preload" href="/assets/css/0.styles.d9c8cf8c.css" as="style"><link rel="preload" href="/assets/js/app.57550e13.js" as="script"><link rel="preload" href="/assets/js/2.f014c35f.js" as="script"><link rel="preload" href="/assets/js/24.0eae7d6f.js" as="script"><link rel="prefetch" href="/assets/js/10.03a98811.js"><link rel="prefetch" href="/assets/js/100.145e708e.js"><link rel="prefetch" href="/assets/js/101.098ca5c8.js"><link rel="prefetch" href="/assets/js/102.4d45c69a.js"><link rel="prefetch" href="/assets/js/103.499de505.js"><link rel="prefetch" href="/assets/js/104.c2c1b9b6.js"><link rel="prefetch" href="/assets/js/105.4e9b0663.js"><link rel="prefetch" href="/assets/js/106.9bb8cf6f.js"><link rel="prefetch" href="/assets/js/107.a81b32d7.js"><link rel="prefetch" href="/assets/js/108.81511e67.js"><link rel="prefetch" href="/assets/js/109.6a6741bf.js"><link rel="prefetch" href="/assets/js/11.e8729182.js"><link rel="prefetch" href="/assets/js/110.de657fe7.js"><link rel="prefetch" href="/assets/js/111.b092af6d.js"><link rel="prefetch" href="/assets/js/112.2dca5709.js"><link rel="prefetch" href="/assets/js/113.dbed1fac.js"><link rel="prefetch" href="/assets/js/114.e95a0131.js"><link rel="prefetch" href="/assets/js/115.2e3e8285.js"><link rel="prefetch" href="/assets/js/116.e64f7fec.js"><link rel="prefetch" href="/assets/js/117.583552c9.js"><link rel="prefetch" href="/assets/js/118.aa5d18f0.js"><link rel="prefetch" href="/assets/js/119.0c7b52d7.js"><link rel="prefetch" href="/assets/js/12.d63acec2.js"><link rel="prefetch" href="/assets/js/120.13f86281.js"><link rel="prefetch" href="/assets/js/121.e2b5b7f9.js"><link rel="prefetch" href="/assets/js/122.5252216a.js"><link rel="prefetch" href="/assets/js/123.8b8a3503.js"><link rel="prefetch" href="/assets/js/124.60df855c.js"><link rel="prefetch" href="/assets/js/125.f073ab1c.js"><link rel="prefetch" href="/assets/js/126.7b73de6a.js"><link rel="prefetch" href="/assets/js/127.4e25971c.js"><link rel="prefetch" href="/assets/js/128.0edf0e06.js"><link rel="prefetch" href="/assets/js/129.5cb5a70a.js"><link rel="prefetch" href="/assets/js/13.2259ef71.js"><link rel="prefetch" href="/assets/js/130.00247fda.js"><link rel="prefetch" href="/assets/js/131.d6fc003a.js"><link rel="prefetch" href="/assets/js/132.1a32b18f.js"><link rel="prefetch" href="/assets/js/133.e46c0193.js"><link rel="prefetch" href="/assets/js/134.a6ad681f.js"><link rel="prefetch" href="/assets/js/135.2fcbe137.js"><link rel="prefetch" href="/assets/js/136.f69bf451.js"><link rel="prefetch" href="/assets/js/137.b9ef2fcc.js"><link rel="prefetch" href="/assets/js/138.7fdd9feb.js"><link rel="prefetch" href="/assets/js/139.a3a37c91.js"><link rel="prefetch" href="/assets/js/14.0d6b23b9.js"><link rel="prefetch" href="/assets/js/140.a7c013ae.js"><link rel="prefetch" href="/assets/js/141.956c36ce.js"><link rel="prefetch" href="/assets/js/142.5aacfe42.js"><link rel="prefetch" href="/assets/js/143.57d691ef.js"><link rel="prefetch" href="/assets/js/144.b1e5766e.js"><link rel="prefetch" href="/assets/js/145.463284b7.js"><link rel="prefetch" href="/assets/js/146.6cc6420c.js"><link rel="prefetch" href="/assets/js/147.5b78c5a2.js"><link rel="prefetch" href="/assets/js/148.8d1d7679.js"><link rel="prefetch" href="/assets/js/149.4e0eb213.js"><link rel="prefetch" href="/assets/js/15.f6fde69d.js"><link rel="prefetch" href="/assets/js/150.b183de37.js"><link rel="prefetch" href="/assets/js/151.729ae770.js"><link rel="prefetch" href="/assets/js/152.b1297018.js"><link rel="prefetch" href="/assets/js/153.bb991bca.js"><link rel="prefetch" href="/assets/js/154.6f2286aa.js"><link rel="prefetch" href="/assets/js/155.6a9c7e4d.js"><link rel="prefetch" href="/assets/js/156.f7bd535d.js"><link rel="prefetch" href="/assets/js/157.64c0065c.js"><link rel="prefetch" href="/assets/js/158.d31ae949.js"><link rel="prefetch" href="/assets/js/159.7daea8a7.js"><link rel="prefetch" href="/assets/js/16.7be21beb.js"><link rel="prefetch" href="/assets/js/160.33cc971a.js"><link rel="prefetch" href="/assets/js/161.1676442a.js"><link rel="prefetch" href="/assets/js/162.71378046.js"><link rel="prefetch" href="/assets/js/163.99e49959.js"><link rel="prefetch" href="/assets/js/164.306f07d2.js"><link rel="prefetch" href="/assets/js/165.170977c7.js"><link rel="prefetch" href="/assets/js/166.f8602525.js"><link rel="prefetch" href="/assets/js/167.eea5c001.js"><link rel="prefetch" href="/assets/js/168.0146a311.js"><link rel="prefetch" href="/assets/js/169.05f9c9d9.js"><link rel="prefetch" href="/assets/js/17.2543f471.js"><link rel="prefetch" href="/assets/js/170.25d602b2.js"><link rel="prefetch" href="/assets/js/171.1ada26a6.js"><link rel="prefetch" href="/assets/js/172.2a0f697c.js"><link rel="prefetch" href="/assets/js/173.230d8ca8.js"><link rel="prefetch" href="/assets/js/174.e3758a2b.js"><link rel="prefetch" href="/assets/js/175.0f19f8ea.js"><link rel="prefetch" href="/assets/js/176.bf70d37d.js"><link rel="prefetch" href="/assets/js/177.4400f272.js"><link rel="prefetch" href="/assets/js/178.85af7b89.js"><link rel="prefetch" href="/assets/js/179.4cfaaaa2.js"><link rel="prefetch" href="/assets/js/18.394415f8.js"><link rel="prefetch" href="/assets/js/180.449c8409.js"><link rel="prefetch" href="/assets/js/181.73276924.js"><link rel="prefetch" href="/assets/js/182.5fab25cc.js"><link rel="prefetch" href="/assets/js/183.ecd4934d.js"><link rel="prefetch" href="/assets/js/184.246092cf.js"><link rel="prefetch" href="/assets/js/185.c671cd86.js"><link rel="prefetch" href="/assets/js/186.49bd1963.js"><link rel="prefetch" href="/assets/js/187.1fb32764.js"><link rel="prefetch" href="/assets/js/188.7c6885e9.js"><link rel="prefetch" href="/assets/js/189.a8701dec.js"><link rel="prefetch" href="/assets/js/19.ca7db8ea.js"><link rel="prefetch" href="/assets/js/190.ae3d3bde.js"><link rel="prefetch" href="/assets/js/191.ad7cd44e.js"><link rel="prefetch" href="/assets/js/192.bc443842.js"><link rel="prefetch" href="/assets/js/193.e4755764.js"><link rel="prefetch" href="/assets/js/194.814112ce.js"><link rel="prefetch" href="/assets/js/195.1c0aaa80.js"><link rel="prefetch" href="/assets/js/196.a6bd7add.js"><link rel="prefetch" href="/assets/js/20.4e91cd31.js"><link rel="prefetch" href="/assets/js/21.f095e6e1.js"><link rel="prefetch" href="/assets/js/22.72f4b8ab.js"><link rel="prefetch" href="/assets/js/23.e94eb9d2.js"><link rel="prefetch" href="/assets/js/25.36157609.js"><link rel="prefetch" href="/assets/js/26.dc5b6cba.js"><link rel="prefetch" href="/assets/js/27.c19b7b63.js"><link rel="prefetch" href="/assets/js/28.3aceae59.js"><link rel="prefetch" href="/assets/js/29.536091b3.js"><link rel="prefetch" href="/assets/js/3.d11119c4.js"><link rel="prefetch" href="/assets/js/30.821a4a30.js"><link rel="prefetch" href="/assets/js/31.5238784c.js"><link rel="prefetch" href="/assets/js/32.10bc7179.js"><link rel="prefetch" href="/assets/js/33.c1ed69c9.js"><link rel="prefetch" href="/assets/js/34.8d384231.js"><link rel="prefetch" href="/assets/js/35.d8890e52.js"><link rel="prefetch" href="/assets/js/36.eca37ad5.js"><link rel="prefetch" href="/assets/js/37.802549e3.js"><link rel="prefetch" href="/assets/js/38.53841770.js"><link rel="prefetch" href="/assets/js/39.7ae44409.js"><link rel="prefetch" href="/assets/js/4.493b9bca.js"><link rel="prefetch" href="/assets/js/40.ce56364a.js"><link rel="prefetch" href="/assets/js/41.85f0114b.js"><link rel="prefetch" href="/assets/js/42.714da6e2.js"><link rel="prefetch" href="/assets/js/43.fee4437c.js"><link rel="prefetch" href="/assets/js/44.b039b68b.js"><link rel="prefetch" href="/assets/js/45.96a55605.js"><link rel="prefetch" href="/assets/js/46.956ffb03.js"><link rel="prefetch" href="/assets/js/47.147d9218.js"><link rel="prefetch" href="/assets/js/48.ff787b40.js"><link rel="prefetch" href="/assets/js/49.871eee87.js"><link rel="prefetch" href="/assets/js/5.e0ba07d7.js"><link rel="prefetch" href="/assets/js/50.99b7c29e.js"><link rel="prefetch" href="/assets/js/51.8ecbf4ba.js"><link rel="prefetch" href="/assets/js/52.53d91d7e.js"><link rel="prefetch" href="/assets/js/53.af8a0d2a.js"><link rel="prefetch" href="/assets/js/54.a2f848b5.js"><link rel="prefetch" href="/assets/js/55.267e9947.js"><link rel="prefetch" href="/assets/js/56.0b201c40.js"><link rel="prefetch" href="/assets/js/57.cbdfd6f7.js"><link rel="prefetch" href="/assets/js/58.636c0c3f.js"><link rel="prefetch" href="/assets/js/59.fc9216c4.js"><link rel="prefetch" href="/assets/js/6.b98373f2.js"><link rel="prefetch" href="/assets/js/60.34f16fc4.js"><link rel="prefetch" href="/assets/js/61.4d130bd8.js"><link rel="prefetch" href="/assets/js/62.927caa10.js"><link rel="prefetch" href="/assets/js/63.a451fee0.js"><link rel="prefetch" href="/assets/js/64.32a5d47b.js"><link rel="prefetch" href="/assets/js/65.bc099429.js"><link rel="prefetch" href="/assets/js/66.3953050d.js"><link rel="prefetch" href="/assets/js/67.e934823b.js"><link rel="prefetch" href="/assets/js/68.4bcb52b0.js"><link rel="prefetch" href="/assets/js/69.bede18c8.js"><link rel="prefetch" href="/assets/js/7.8de8df2d.js"><link rel="prefetch" href="/assets/js/70.fce1daac.js"><link rel="prefetch" href="/assets/js/71.ea0a8c5d.js"><link rel="prefetch" href="/assets/js/72.15382c9e.js"><link rel="prefetch" href="/assets/js/73.848364d3.js"><link rel="prefetch" href="/assets/js/74.5fd08a50.js"><link rel="prefetch" href="/assets/js/75.c937c70d.js"><link rel="prefetch" href="/assets/js/76.a0dacd5a.js"><link rel="prefetch" href="/assets/js/77.4019cc23.js"><link rel="prefetch" href="/assets/js/78.9676a9e1.js"><link rel="prefetch" href="/assets/js/79.e46e10d5.js"><link rel="prefetch" href="/assets/js/8.2098eb96.js"><link rel="prefetch" href="/assets/js/80.987e83cb.js"><link rel="prefetch" href="/assets/js/81.eb98ff36.js"><link rel="prefetch" href="/assets/js/82.623561a7.js"><link rel="prefetch" href="/assets/js/83.e256d909.js"><link rel="prefetch" href="/assets/js/84.7d06a550.js"><link rel="prefetch" href="/assets/js/85.b8d9879e.js"><link rel="prefetch" href="/assets/js/86.31c4581b.js"><link rel="prefetch" href="/assets/js/87.e06ee05e.js"><link rel="prefetch" href="/assets/js/88.81ef718d.js"><link rel="prefetch" href="/assets/js/89.ba237d2f.js"><link rel="prefetch" href="/assets/js/9.36092fd0.js"><link rel="prefetch" href="/assets/js/90.ad2c9d92.js"><link rel="prefetch" href="/assets/js/91.a661f52d.js"><link rel="prefetch" href="/assets/js/92.1c28035b.js"><link rel="prefetch" href="/assets/js/93.c8b8e3d6.js"><link rel="prefetch" href="/assets/js/94.b6bc4a44.js"><link rel="prefetch" href="/assets/js/95.92cea882.js"><link rel="prefetch" href="/assets/js/96.5373491b.js"><link rel="prefetch" href="/assets/js/97.bb39efc8.js"><link rel="prefetch" href="/assets/js/98.af7a030f.js"><link rel="prefetch" href="/assets/js/99.07dc87d8.js">
    <link rel="stylesheet" href="/assets/css/0.styles.d9c8cf8c.css">
  </head>
  <body class="theme-mode-light">
    <div id="app" data-server-rendered="true"><div class="theme-container sidebar-open have-rightmenu"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="https://lingxin-tanhua.oss-cn-shanghai.aliyuncs.com/QQ%E6%88%AA%E5%9B%BE20220503092755.png" alt="凌歆的博客" class="logo"> <span class="site-name can-hide">凌歆的博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端" class="dropdown-title"><a href="/web/" class="link-title">前端</a> <span class="title" style="display:none;">前端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>学习笔记</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/note/html/" class="nav-link">HTML笔记</a></li><li class="dropdown-subitem"><a href="/note/js-low/" class="nav-link">JavaScript基础笔记</a></li><li class="dropdown-subitem"><a href="/note/js-high/" class="nav-link">JavaScript高阶笔记</a></li><li class="dropdown-subitem"><a href="/note/js-dom-bom/" class="nav-link">JavaScript DOM和BOM笔记</a></li><li class="dropdown-subitem"><a href="/note/jquery/" class="nav-link">jQuery笔记</a></li><li class="dropdown-subitem"><a href="/note/ajax/" class="nav-link">Ajax笔记</a></li><li class="dropdown-subitem"><a href="/note/nodejs/" class="nav-link">NodeJs笔记</a></li><li class="dropdown-subitem"><a href="/note/reg/" class="nav-link">正则表达式笔记</a></li><li class="dropdown-subitem"><a href="/note/vue/" class="nav-link">Vue笔记</a></li><li class="dropdown-subitem"><a href="/note/react/" class="nav-link">react笔记</a></li><li class="dropdown-subitem"><a href="/note/wx/" class="nav-link">微信小程序笔记</a></li><li class="dropdown-subitem"><a href="/note/uniapp/" class="nav-link">uniapp笔记</a></li><li class="dropdown-subitem"><a href="/note/echarts/" class="nav-link">echarts笔记</a></li><li class="dropdown-subitem"><a href="/note/git/" class="nav-link">Git笔记</a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="后端" class="dropdown-title"><a href="/back/" class="link-title">后端</a> <span class="title" style="display:none;">后端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/java/" class="nav-link">JAVA</a></li><li class="dropdown-item"><!----> <a href="/note/javaweb/" class="nav-link">JavaWeb</a></li><li class="dropdown-item"><!----> <a href="/note/mysql/" class="nav-link">MySql</a></li><li class="dropdown-item"><!----> <a href="/note/ssm/" class="nav-link">ssm</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="算法" class="dropdown-title"><a href="/algor/" class="link-title">算法</a> <span class="title" style="display:none;">算法</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/sf/" class="nav-link">算法训练营</a></li><li class="dropdown-item"><!----> <a href="/note/js-sf/" class="nav-link">js数据结构与算法</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="面试" class="dropdown-title"><a href="/mianshi/" class="link-title">面试</a> <span class="title" style="display:none;">面试</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/lqb/" class="nav-link">蓝桥杯备战</a></li><li class="dropdown-item"><!----> <a href="/note/ms/" class="nav-link">前端面试</a></li><li class="dropdown-item"><!----> <a href="/note/hmms/" class="nav-link">黑马面试</a></li><li class="dropdown-item"><!----> <a href="/note/xzms/" class="nav-link">校招零距离面试</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="解决方案" class="dropdown-title"><a href="/resolve/" class="link-title">解决方案</a> <span class="title" style="display:none;">解决方案</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/qd-resolve/" class="nav-link">前端解决方案</a></li><li class="dropdown-item"><!----> <a href="/note/hd-resolve/" class="nav-link">后端解决方案</a></li></ul></div></div><div class="nav-item"><a href="/pages/beb6c0bd8a66cea6/" class="nav-link">收藏</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="索引" class="dropdown-title"><a href="/archives/" class="link-title">索引</a> <span class="title" style="display:none;">索引</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/" class="nav-link">分类</a></li><li class="dropdown-item"><!----> <a href="/tags/" class="nav-link">标签</a></li><li class="dropdown-item"><!----> <a href="/archives/" class="nav-link">归档</a></li></ul></div></div> <a href="https://github.com/linxin1123/vuepress-blog" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar-hover-trigger"></div> <aside class="sidebar" style="display:none;"><div class="blogger"><img src="https://lingxin-tanhua.oss-cn-shanghai.aliyuncs.com/QQ%E6%88%AA%E5%9B%BE20220503092755.png"> <div class="blogger-info"><h3>lingxin</h3> <span>凌歆</span></div></div> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端" class="dropdown-title"><a href="/web/" class="link-title">前端</a> <span class="title" style="display:none;">前端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>学习笔记</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/note/html/" class="nav-link">HTML笔记</a></li><li class="dropdown-subitem"><a href="/note/js-low/" class="nav-link">JavaScript基础笔记</a></li><li class="dropdown-subitem"><a href="/note/js-high/" class="nav-link">JavaScript高阶笔记</a></li><li class="dropdown-subitem"><a href="/note/js-dom-bom/" class="nav-link">JavaScript DOM和BOM笔记</a></li><li class="dropdown-subitem"><a href="/note/jquery/" class="nav-link">jQuery笔记</a></li><li class="dropdown-subitem"><a href="/note/ajax/" class="nav-link">Ajax笔记</a></li><li class="dropdown-subitem"><a href="/note/nodejs/" class="nav-link">NodeJs笔记</a></li><li class="dropdown-subitem"><a href="/note/reg/" class="nav-link">正则表达式笔记</a></li><li class="dropdown-subitem"><a href="/note/vue/" class="nav-link">Vue笔记</a></li><li class="dropdown-subitem"><a href="/note/react/" class="nav-link">react笔记</a></li><li class="dropdown-subitem"><a href="/note/wx/" class="nav-link">微信小程序笔记</a></li><li class="dropdown-subitem"><a href="/note/uniapp/" class="nav-link">uniapp笔记</a></li><li class="dropdown-subitem"><a href="/note/echarts/" class="nav-link">echarts笔记</a></li><li class="dropdown-subitem"><a href="/note/git/" class="nav-link">Git笔记</a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="后端" class="dropdown-title"><a href="/back/" class="link-title">后端</a> <span class="title" style="display:none;">后端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/java/" class="nav-link">JAVA</a></li><li class="dropdown-item"><!----> <a href="/note/javaweb/" class="nav-link">JavaWeb</a></li><li class="dropdown-item"><!----> <a href="/note/mysql/" class="nav-link">MySql</a></li><li class="dropdown-item"><!----> <a href="/note/ssm/" class="nav-link">ssm</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="算法" class="dropdown-title"><a href="/algor/" class="link-title">算法</a> <span class="title" style="display:none;">算法</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/sf/" class="nav-link">算法训练营</a></li><li class="dropdown-item"><!----> <a href="/note/js-sf/" class="nav-link">js数据结构与算法</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="面试" class="dropdown-title"><a href="/mianshi/" class="link-title">面试</a> <span class="title" style="display:none;">面试</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/lqb/" class="nav-link">蓝桥杯备战</a></li><li class="dropdown-item"><!----> <a href="/note/ms/" class="nav-link">前端面试</a></li><li class="dropdown-item"><!----> <a href="/note/hmms/" class="nav-link">黑马面试</a></li><li class="dropdown-item"><!----> <a href="/note/xzms/" class="nav-link">校招零距离面试</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="解决方案" class="dropdown-title"><a href="/resolve/" class="link-title">解决方案</a> <span class="title" style="display:none;">解决方案</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/note/qd-resolve/" class="nav-link">前端解决方案</a></li><li class="dropdown-item"><!----> <a href="/note/hd-resolve/" class="nav-link">后端解决方案</a></li></ul></div></div><div class="nav-item"><a href="/pages/beb6c0bd8a66cea6/" class="nav-link">收藏</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="索引" class="dropdown-title"><a href="/archives/" class="link-title">索引</a> <span class="title" style="display:none;">索引</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/" class="nav-link">分类</a></li><li class="dropdown-item"><!----> <a href="/tags/" class="nav-link">标签</a></li><li class="dropdown-item"><!----> <a href="/archives/" class="nav-link">归档</a></li></ul></div></div> <a href="https://github.com/linxin1123/vuepress-blog" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>学习笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>HTML笔记</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/pages/5ac886/" aria-current="page" class="active sidebar-link">HTML与CSS学习第1天</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_1-网页" class="sidebar-link">1. 网页</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_1-1-网页介绍" class="sidebar-link">1.1 网页介绍</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_1-2-html-本质" class="sidebar-link">1.2 HTML 本质</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_2-web-标准" class="sidebar-link">2. web 标准</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_2-1-web-标准定义" class="sidebar-link">2.1 web 标准定义</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_2-2-web-标准作用" class="sidebar-link">2.2 web 标准作用</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_2-3-web-标准的构成" class="sidebar-link">2.3 web 标准的构成</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_3-html-语法介绍" class="sidebar-link">3. HTML 语法介绍</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_3-1-基本语法" class="sidebar-link">3.1. 基本语法</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_3-2-结构图" class="sidebar-link">3.2 结构图</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_4-vscode-编译器使用" class="sidebar-link">4. VSCode 编译器使用</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_4-1-快捷键使用" class="sidebar-link">4.1 快捷键使用</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_5-html-常用标签" class="sidebar-link">5. HTML 常用标签</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-1-标题标签" class="sidebar-link">5.1 标题标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-2-段落标签" class="sidebar-link">5.2 段落标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-3-换行标签" class="sidebar-link">5.3 换行标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-4-一些格式化标签" class="sidebar-link">5.4 一些格式化标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-5-div-和-span-标签" class="sidebar-link">5.5 div 和 span 标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-6-图像标签" class="sidebar-link">5.6 图像标签</a></li><li class="sidebar-sub-header level4"><a href="/pages/5ac886/#注意点" class="sidebar-link">注意点</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-7-音频标签" class="sidebar-link">5.7 音频标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-8-视频标签" class="sidebar-link">5.8 视频标签</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_5-9-水平线线标签" class="sidebar-link">5.9 水平线线标签</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_6-文件路径" class="sidebar-link">6.文件路径</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_6-1-路径的相对路径" class="sidebar-link">6.1 路径的相对路径</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_6-2-路径的绝对路径" class="sidebar-link">6.2 路径的绝对路径</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_7-超链接标签" class="sidebar-link">7.超链接标签</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_7-1-链接的语法格式" class="sidebar-link">7.1 链接的语法格式</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_7-2-链接的属性" class="sidebar-link">7.2 链接的属性</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_7-3-链接分类" class="sidebar-link">7.3 链接分类</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_8-html-注释和特殊字符" class="sidebar-link">8.HTML 注释和特殊字符</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_8-1-html-注释格式" class="sidebar-link">8.1 HTML 注释格式</a></li><li class="sidebar-sub-header level3"><a href="/pages/5ac886/#_8-2-特殊字符" class="sidebar-link">8.2 特殊字符</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/5ac886/#_9-html-标签与标签之间的关系" class="sidebar-link">9. HTML 标签与标签之间的关系</a></li></ul></li><li><a href="/pages/fa03a8/" class="sidebar-link">HTML与CSS学习第2天</a></li><li><a href="/pages/1fa81f/" class="sidebar-link">HTML与CSS学习第3天</a></li><li><a href="/pages/024faa/" class="sidebar-link">HTML与CSS学习第4天</a></li><li><a href="/pages/458e73/" class="sidebar-link">HTML与CSS学习第5天</a></li><li><a href="/pages/3744f7/" class="sidebar-link">HTML与CSS学习第6天</a></li><li><a href="/pages/3c5d9c/" class="sidebar-link">HTML与CSS学习第7天</a></li><li><a href="/pages/bab88d/" class="sidebar-link">HTML与CSS学习第8天</a></li><li><a href="/pages/5278af/" class="sidebar-link">HTML与CSS学习第9天</a></li><li><a href="/pages/7ec7bd/" class="sidebar-link">HTML与CSS学习第10天</a></li><li><a href="/pages/97b379/" class="sidebar-link">HTML与CSS学习第12天</a></li><li><a href="/pages/c1cfa1/" class="sidebar-link">HTML与CSS学习第13天</a></li><li><a href="/pages/8ea5ad/" class="sidebar-link">HTML与CSS学习第14天</a></li><li><a href="/pages/e01d7a/" class="sidebar-link">HTML与CSS学习第15天</a></li><li><a href="/pages/e18c91/" class="sidebar-link">HTML与CSS学习第16天</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>JavaScript基础笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>JavaScript高阶笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>JavaScript DOM和BOM笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>jQuery笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Ajax笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>NodeJs笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>正则表达式笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Vue笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>React笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Git笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>echarts笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>微信小程序笔记</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>uniapp笔记</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <div><main class="page"><div class="theme-vdoing-wrapper "><div class="articleInfo-wrap" data-v-06225672><div class="articleInfo" data-v-06225672><ul class="breadcrumbs" data-v-06225672><li data-v-06225672><a href="/" title="首页" class="iconfont icon-home router-link-active" data-v-06225672></a></li> <li data-v-06225672><a href="/web/#前端" data-v-06225672>前端</a></li><li data-v-06225672><a href="/web/#HTML笔记" data-v-06225672>HTML笔记</a></li></ul> <div class="info" data-v-06225672><div title="作者" class="author iconfont icon-touxiang" data-v-06225672><a href="https://github.com/linxin1123" target="_blank" title="作者" class="beLink" data-v-06225672>lingxin</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-06225672><a href="javascript:;" data-v-06225672>2023-01-25</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-title">目录</div> <div class="right-menu-content"></div></div></div> <h1><img src="">HTML与CSS学习第1天<span class="title-tag">原创</span></h1>  <div class="theme-vdoing-content content__default"><h1 id="html-与-css-学习第一天"><a href="#html-与-css-学习第一天" class="header-anchor">#</a> HTML 与 CSS 学习第一天</h1> <p><img src="https://img-blog.csdnimg.cn/67b9294f31434229bb68dc17587cddbc.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5YeM5q2G,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center" alt="在这里插入图片描述"></p> <h2 id="_1-网页"><a href="#_1-网页" class="header-anchor">#</a> 1. 网页</h2> <h3 id="_1-1-网页介绍"><a href="#_1-1-网页介绍" class="header-anchor">#</a> 1.1 网页介绍</h3> <ul><li><p><strong>网页</strong>是网站的一“页”，通常是<strong>HTML</strong>格式的文件，通过浏览器来阅读。</p></li> <li><p><strong>网站</strong>是在因特网上根据一定的规则，使用<strong>HTML</strong>等制作的用于展示特点内容相关的<strong>网页</strong>集合</p></li> <li><p>网页本质是<strong>HTML 文件</strong>，通常由图片，链接，视频，音频，文字等元素组成。</p></li></ul> <h3 id="_1-2-html-本质"><a href="#_1-2-html-本质" class="header-anchor">#</a> 1.2 HTML 本质</h3> <ul><li><p>HTML 是 <strong><em>超文本标记语言(Hyper Text Markup Language)</em></strong></p></li> <li><p>是<strong>标记语言</strong>，和 markdown 类似，不是编程语言</p></li></ul> <h2 id="_2-web-标准"><a href="#_2-web-标准" class="header-anchor">#</a> 2. web 标准</h2> <h3 id="_2-1-web-标准定义"><a href="#_2-1-web-标准定义" class="header-anchor">#</a> 2.1 web 标准定义</h3> <p>web 标准是有<strong>W3C 组织</strong>和其他标准化组织制定的一系列标准的的集合。</p> <p><strong>W3C</strong>：万维网联盟。</p> <h3 id="_2-2-web-标准作用"><a href="#_2-2-web-标准作用" class="header-anchor">#</a> 2.2 web 标准作用</h3> <p>不同的浏览器解析<strong>各自标准的 HTML 文件</strong>得到的效果不同，为了让在不同浏览器<strong>解析的效果相同</strong>，就需要 web 标准。</p> <h3 id="_2-3-web-标准的构成"><a href="#_2-3-web-标准的构成" class="header-anchor">#</a> 2.3 web 标准的构成</h3> <ul><li>主要由<strong>结构，表现，行为</strong>三个方面</li> <li><strong>结构，行为，样式</strong>分离</li> <li>表格</li></ul> <table><thead><tr><th>标准</th> <th>说明</th></tr></thead> <tbody><tr><td>结构</td> <td><strong>结构</strong>用于对网页元素进行<strong>整理和分类</strong>，现阶段主要学 HTML。</td></tr> <tr><td>表现</td> <td>表现用于设置网页元素的<strong>版式、颜色、大小等外观样式</strong>，主要指 CSS。</td></tr> <tr><td>行为</td> <td>行为是指<strong>网页模型的定义及其交互</strong>的编写，现在主要学 JavaScript。</td></tr></tbody></table> <h2 id="_3-html-语法介绍"><a href="#_3-html-语法介绍" class="header-anchor">#</a> 3. HTML 语法介绍</h2> <h3 id="_3-1-基本语法"><a href="#_3-1-基本语法" class="header-anchor">#</a> 3.1. 基本语法</h3> <ul><li><p><strong>HTML</strong>标签是由<strong>尖括号包围的关键词</strong>，如<code>&lt;Html&gt;</code>。</p></li> <li><p>双标签：<strong>成对出现</strong>，如<code>&lt;HTML&gt;&lt;/HTML&gt;</code>，前面的称<strong>开始标签</strong>，后面为<strong>结束标签</strong>。</p></li> <li><p><strong>单标签</strong>：<code>&lt;br&gt;</code>,<code>&lt;img&gt;</code>标签。</p></li></ul> <h3 id="_3-2-结构图"><a href="#_3-2-结构图" class="header-anchor">#</a> 3.2 结构图</h3> <p><img src="https://img-blog.csdnimg.cn/ec6f07bcd4d043a1902cb06da85a0976.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMzM5MzgyMzQ=,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center" alt="HTML结构图"></p> <h2 id="_4-vscode-编译器使用"><a href="#_4-vscode-编译器使用" class="header-anchor">#</a> 4. VSCode 编译器使用</h2> <h3 id="_4-1-快捷键使用"><a href="#_4-1-快捷键使用" class="header-anchor">#</a> 4.1 快捷键使用</h3> <ul><li><p><strong>！+table/回车</strong> ：生成<strong>文档类型声明标签（&lt;!DOCTYPE&gt;）</strong>，告诉浏览器使用何种 HTML 版本显示网页。</p></li> <li><p><strong>Ctrl+D</strong>:在选中一个关键字或内容的情况下，加选相同的内容。</p></li> <li><p><strong>alt+鼠标左键</strong>：加选光标，配合 crtl+shift+左方向键使用。</p></li> <li><p><strong>crtl+shift+左方向键</strong>：选择所有光标的左边部分。</p></li></ul> <h2 id="_5-html-常用标签"><a href="#_5-html-常用标签" class="header-anchor">#</a> 5. HTML 常用标签</h2> <h3 id="_5-1-标题标签"><a href="#_5-1-标题标签" class="header-anchor">#</a> 5.1 标题标签</h3> <ul><li><p><strong><code>&lt;H1&gt;-&lt;H5&gt;</code></strong></p></li> <li><p>标签语义：标题使用，<strong>根据重要性从 1 到 6 递减。</strong></p></li> <li><p>特点：1. 文字会变粗，字号会变大。</p> <p>​ <strong>2.一个标题独占一行。</strong></p></li></ul> <h3 id="_5-2-段落标签"><a href="#_5-2-段落标签" class="header-anchor">#</a> 5.2 段落标签</h3> <ul><li><strong><code>&lt;p&gt;&lt;/p&gt;</code></strong> <ul><li>标签语义：可以把 HTML 文档分割成若干段落。</li> <li>特点：1. 一个段落中的文本会<strong>根据浏览器窗口的大小自 动换行。</strong> 2. <strong>段落和段落之间保有间隙。</strong></li></ul></li></ul> <p>​</p> <h3 id="_5-3-换行标签"><a href="#_5-3-换行标签" class="header-anchor">#</a> 5.3 换行标签</h3> <ul><li><strong><code>&lt;br&gt;</code></strong> <strong>标签</strong> <ul><li>标签语义：强制换行。</li> <li>特点：
<ul><li>单标签。</li> <li><strong>标签简单的开始下一行，和段落间隙不一样（段落之间有垂直间距）。</strong></li></ul></li></ul></li></ul> <h3 id="_5-4-一些格式化标签"><a href="#_5-4-一些格式化标签" class="header-anchor">#</a> 5.4 一些格式化标签</h3> <table><thead><tr><th>语义</th> <th>标签</th> <th>说明</th></tr></thead> <tbody><tr><td>加粗</td> <td><code>&lt;strong&gt;&lt;/strong&gt;</code>或<code>&lt;b&gt;&lt;/b&gt;</code></td> <td>推荐使用 strong 标签，加粗</td></tr> <tr><td>倾斜</td> <td><code>&lt;em&gt;&lt;/em&gt;</code>或<code>&lt;i&gt;&lt;/i&gt;</code></td> <td>推荐使用 em 标签倾斜，倾斜</td></tr> <tr><td>删除线</td> <td><code>&lt;del&gt;&lt;/del&gt;</code>或<code>&lt;s&gt;&lt;/s&gt;</code></td> <td>推荐使用 del 标签加上删除线</td></tr> <tr><td>下划线</td> <td><code>&lt;ins&gt;&lt;/ins&gt;</code>或<code>&lt;u&gt;&lt;/u&gt;</code></td> <td>推荐使用 ins 标签加上下划线</td></tr></tbody></table> <h3 id="_5-5-div-和-span-标签"><a href="#_5-5-div-和-span-标签" class="header-anchor">#</a> 5.5 div 和 span 标签</h3> <table><thead><tr><th>标签</th> <th>相同点</th> <th>不同点</th></tr></thead> <tbody><tr><td>div</td> <td>无语义标签</td> <td>一行放一个，大盒子</td></tr> <tr><td>span</td> <td>无语义标签</td> <td>一行放多个，小盒子</td></tr></tbody></table> <h3 id="_5-6-图像标签"><a href="#_5-6-图像标签" class="header-anchor">#</a> 5.6 图像标签</h3> <ul><li><p><code>&lt;img&gt;</code></p> <ul><li>特点：单标签</li> <li>语义：图像</li> <li><strong>src 属性是该标签必须的</strong></li></ul></li> <li><p><strong>标签属性介绍</strong></p></li></ul> <table><thead><tr><th>属性</th> <th>属性值</th> <th>说明</th></tr></thead> <tbody><tr><td>src</td> <td>图片路径</td> <td>必须属性</td></tr> <tr><td>alt</td> <td>文本</td> <td>替换文本，图像加载失败时显示</td></tr> <tr><td>title</td> <td>文本</td> <td>提示文本，鼠标悬停在图片上显示的文字</td></tr> <tr><td>width</td> <td>像素（px）</td> <td>设置图像的宽度</td></tr> <tr><td>height</td> <td>像素</td> <td>设置图像的高度</td></tr> <tr><td>border</td> <td>像素</td> <td>设置图像边框的粗细</td></tr></tbody></table> <h4 id="注意点"><a href="#注意点" class="header-anchor">#</a> 注意点</h4> <ul><li>图像标签拥有多个属性，每个属性写在标签的后面，如<code>&lt;img src=&quot;xxx&quot; alt=&quot;加载失败&quot;&gt;</code></li> <li>属性之间不分先后顺序，<strong>属性与属性之间用空格隔开</strong></li> <li>属性与属性值的书写格式：<strong>key=“value”格式</strong></li></ul> <h3 id="_5-7-音频标签"><a href="#_5-7-音频标签" class="header-anchor">#</a> 5.7 音频标签</h3> <ul><li>目前<strong>支持三种格式</strong>：MP3，wav，ogg</li> <li>格式</li></ul> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>audio</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>音频路径<span class="token punctuation">&quot;</span></span> <span class="token attr-name">controls</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>audio</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><ul><li>常用属性</li></ul> <table><thead><tr><th>属性名</th> <th>功能</th></tr></thead> <tbody><tr><td>src</td> <td>音频路径</td></tr> <tr><td>controls</td> <td>显示播放控件</td></tr> <tr><td>autoplay</td> <td>自动播放（部分浏览器不支持）</td></tr> <tr><td>loop</td> <td>循环播放</td></tr></tbody></table> <ul><li>插图</li></ul> <p><img src="https://img-blog.csdnimg.cn/48c87570a3eb467587f55628d2158e86.png#pic_center" alt="音频标签效果图"></p> <h3 id="_5-8-视频标签"><a href="#_5-8-视频标签" class="header-anchor">#</a> 5.8 视频标签</h3> <ul><li>目前支持<strong>三种格式</strong>：MP4，webm，ogg。</li> <li>格式</li></ul> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>video</span> <span class="token attr-name">src+&quot;视频路径&quot;</span> <span class="token attr-name">controls</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>video</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><ul><li>常用属性</li></ul> <table><thead><tr><th>属性名</th> <th>功能</th></tr></thead> <tbody><tr><td>src</td> <td>视频路径</td></tr> <tr><td>controls</td> <td>显示播放控件</td></tr> <tr><td>autoplay</td> <td>自动播放（谷歌浏览器需配合 mutex 实现静音播放）</td></tr> <tr><td>loop</td> <td>循环播放</td></tr></tbody></table> <h3 id="_5-9-水平线线标签"><a href="#_5-9-水平线线标签" class="header-anchor">#</a> 5.9 水平线线标签</h3> <ul><li>单标签</li> <li>在页面中显示一条水平线</li> <li>格式</li></ul> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>hr</span> <span class="token punctuation">/&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="_6-文件路径"><a href="#_6-文件路径" class="header-anchor">#</a> 6.文件路径</h2> <h3 id="_6-1-路径的相对路径"><a href="#_6-1-路径的相对路径" class="header-anchor">#</a> 6.1 路径的相对路径</h3> <ul><li><strong>定义：以引用文件所在位置为参考基础，而建立出的目录路径</strong></li> <li>图表介绍</li></ul> <table><thead><tr><th>相对路径类别</th> <th>符号</th> <th>说明</th></tr></thead> <tbody><tr><td>同级目录</td> <td></td> <td>直接写路径名</td></tr> <tr><td>下级目录</td> <td>/</td> <td>当前目录下的文件</td></tr> <tr><td>上级目录</td> <td>../</td> <td>回到上级目录</td></tr></tbody></table> <h3 id="_6-2-路径的绝对路径"><a href="#_6-2-路径的绝对路径" class="header-anchor">#</a> 6.2 路径的绝对路径</h3> <ul><li>绝对路径：通常为以盘符开始的路径。</li></ul> <h2 id="_7-超链接标签"><a href="#_7-超链接标签" class="header-anchor">#</a> 7.超链接标签</h2> <h3 id="_7-1-链接的语法格式"><a href="#_7-1-链接的语法格式" class="header-anchor">#</a> 7.1 链接的语法格式</h3> <ul><li>a 即英文单词 anchor，锚点</li></ul> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>跳转目标<span class="token punctuation">&quot;</span></span> <span class="token attr-name">target</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>目标窗口的弹出方式<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>文本或图像<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h3 id="_7-2-链接的属性"><a href="#_7-2-链接的属性" class="header-anchor">#</a> 7.2 链接的属性</h3> <table><thead><tr><th>属性</th> <th>作用</th></tr></thead> <tbody><tr><td>href</td> <td>用于指定链接的<strong>URl（统一资源定位符）地址</strong>，必须属性，标签具有 href 属性时，他就拥有了超链接的功能</td></tr> <tr><td><strong>target</strong></td> <td>指定链接页面的打开方式，_self 为默认值，当前窗口打开， _ blank 在新窗口打开</td></tr></tbody></table> <h3 id="_7-3-链接分类"><a href="#_7-3-链接分类" class="header-anchor">#</a> 7.3 链接分类</h3> <table><thead><tr><th>链接类别</th> <th>举例</th> <th>说明</th></tr></thead> <tbody><tr><td>外部链接</td> <td><code>&lt;a href=&quot;https://www.baidu.com&quot;&gt;百度一下&lt;/a&gt;</code></td> <td>外部的资源链接</td></tr> <tr><td>内部链接</td> <td><code>&lt;a href=&quot;index.html&quot;&gt;内部资源&lt;/a&gt;</code></td> <td>链接访问本地资源,<strong>网站内部页面之间的相互链接</strong>，直接链接内部名称即可。</td></tr> <tr><td>空链接</td> <td><code>&lt;a href=&quot;#&quot;&gt;回到顶部&lt;/a&gt;</code></td> <td>没有确定链接时，<strong>单击可以回到页面顶部</strong></td></tr> <tr><td>下载链接</td> <td><code>&lt;a href=&quot;一个文件或压缩包地址&quot;&gt;下载&lt;/a&gt;</code></td> <td>下载地址对应的文件</td></tr> <tr><td>网页元素链接</td> <td></td> <td>网页中的各种元素，如文本，音频，视频，表格，图像都可以添加超链接</td></tr> <tr><td><strong>锚点链接</strong></td> <td>目标位置：<code>&lt;h3 id=&quot;two&quot;&gt;HTML介绍&lt;/h3&gt;</code><br> 链接位置：<code>&lt;a href=&quot;#two&quot;&gt;html介绍&lt;/a&gt;</code></td> <td>通过点击，可以迅速<strong>定位到页面中的某个位置</strong></td></tr></tbody></table> <h2 id="_8-html-注释和特殊字符"><a href="#_8-html-注释和特殊字符" class="header-anchor">#</a> 8.HTML 注释和特殊字符</h2> <h3 id="_8-1-html-注释格式"><a href="#_8-1-html-注释格式" class="header-anchor">#</a> 8.1 HTML 注释格式</h3> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token comment">&lt;!-- 注释语句--&gt;</span>
vscode快捷键：ctrl+/ /* 注释语句 */ 标签内的注释样式
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h3 id="_8-2-特殊字符"><a href="#_8-2-特殊字符" class="header-anchor">#</a> 8.2 特殊字符</h3> <table><thead><tr><th>特殊字符</th> <th>描述</th> <th>字符的代码</th></tr></thead> <tbody><tr><td></td> <td>空格符</td> <td><code>&amp;nbsp;</code></td></tr> <tr><td>&lt;</td> <td>小于号</td> <td><code>&amp;lt;</code></td></tr> <tr><td>&gt;</td> <td>大于号</td> <td><code>&amp;gt;</code></td></tr> <tr><td>&amp;</td> <td>和号</td> <td><code>&amp;amp;</code></td></tr></tbody></table> <h2 id="_9-html-标签与标签之间的关系"><a href="#_9-html-标签与标签之间的关系" class="header-anchor">#</a> 9. HTML 标签与标签之间的关系</h2> <ul><li>父子关系（嵌套关系）</li></ul> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><ul><li>兄弟关系（并列关系）</li></ul> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></div></div>  <div class="page-edit"><div class="edit-link"><a href="https://github.com/linxin1123/vuepress-blog/edit/master/docs/01.前端/41.HTML笔记/01.HTML与CSS学习第1天.md" target="_blank" rel="noopener noreferrer">编辑</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2023/02/17, 11:29:32</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/note/git/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">Git笔记</div></a> <a href="/pages/fa03a8/" class="page-nav-centre page-nav-centre-next"><div class="tooltip">HTML与CSS学习第2天</div></a></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/note/git/" class="prev">Git笔记</a></span> <span class="next"><a href="/pages/fa03a8/">HTML与CSS学习第2天</a>→
      </span></p></div></div></div> <div class="article-list"><div class="article-title"><a href="/archives/" class="iconfont icon-bi">最近更新</a></div> <div class="article-wrapper"><dl><dd>01</dd> <dt><a href="/pages/0b785d/"><div>
            Vuex
            <!----></div></a> <span class="date">03-14</span></dt></dl><dl><dd>02</dd> <dt><a href="/pages/c59cc0/"><div>
            Vue响应式原理
            <!----></div></a> <span class="date">03-14</span></dt></dl><dl><dd>03</dd> <dt><a href="/pages/83cc7a/"><div>
            Vue虚拟DOM-cnblog
            <!----></div></a> <span class="date">03-14</span></dt></dl> <dl><dd></dd> <dt><a href="/archives/" class="more">更多文章&gt;</a></dt></dl></div></div></main></div> <div class="footer"><div class="icons"><a href="3010733382@qq.com" title="发邮件" target="_blank" class="iconfont icon-youjian"></a><a href="https://github.com/linxin1123" title="GitHub" target="_blank" class="iconfont icon-github"></a><a href="https://music.163.com/#/playlist?id=755597173" title="听音乐" target="_blank" class="iconfont icon-erji"></a></div> 
  Theme by
  <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank" title="本站主题">Vdoing</a> 
    | Copyright © 2022-2023
    <span>lingxin | <a href="https://github.com/linxin1123/vuepress-blog/blob/master/LICENSE" target="_blank">MIT License</a></span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">
          跟随系统
        </li><li class="iconfont icon-rijianmoshi">
          浅色模式
        </li><li class="iconfont icon-yejianmoshi">
          深色模式
        </li><li class="iconfont icon-yuedu">
          阅读模式
        </li></ul></div></div> <!----> <!----> <!----></div><div class="global-ui"><div></div></div></div>
    <script src="/assets/js/app.57550e13.js" defer></script><script src="/assets/js/2.f014c35f.js" defer></script><script src="/assets/js/24.0eae7d6f.js" defer></script>
  </body>
</html>
